Load files to a server to run this sample. And then, double-click ExtInt.html to play the sample.

This sample, ExtInt.fla, demonstrates how to use the External API (ExternalInterface class) to send text to and from ActionScript and JavaScript. 

ActionScript > JavaScript
JavaScript > ActionScript 

To send ActionScript to JavaScript, follow these two steps:

1) Type "test" in the "Sending to JavaScript" text field.
2) Click "Send".

Your text displays in the "Receiving from ActionScript" text field.

To send JavaScript to ActionScript, follow these two steps:

1) Type "test2" in the "Sending to ActionScript" text field.
2) Click "Send".

Your text displays in the "Receiving from JavaScript" text field.